import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import WelCome from '../components/WelCome.vue'
import Md from '../components/Md.vue'
import Class from '../components/Class/Class.vue'
import Register from '../components/Register.vue'
import Pay from '../components/Pay.vue'
import NotFount from '../components/404/NotFount.vue'
// 课程相关
import ClassDetail from '../components/Class/ClassDetail.vue'
import ji from '../components/Class/JudgeInfo.vue'
import Juan from '../components/Class/Juan.vue'
import KaoShi from '../components/Class/KaoShi.vue'
import Video from '../components/Class/Video.vue'

// 搜索相关
import Search from '../components/SearchPage/Search.vue'
import SearchResult from '../components/SearchPage/SearchResult.vue'


//购买相关
import Purchase from '../components/Buy/Purchase.vue'
import Success from '../components/Buy/Success.vue'
import Enterprise from '../components/Buy/Enterprise.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    component: Home,
    redirect: '/welcome',
    children: [{
      path: '/welcome',
      component: WelCome
    }, {
      path: '/search',
      component: Search
    }, {
      path: '/md',
      component: Md
    }, {
      path: '/class',
      component: Class
    }, {
      path: '/pay',
      component: Pay
    }, {
      path: '/detail/class',
      component: ClassDetail
    }, {
      path: '/purchase',
      component: Purchase
    }, {
      path: '/enterprise',
      component: Enterprise
    }, {
      path: '/success',
      component: Success
    }, {
      path: '/ji',
      component: ji
    }, {
      path: '/juan',
      component: Juan
    }, {
      path: '/kaoshi',
      component: KaoShi
    }, {
      path: '/video',
      component: Video
    }, {
      path: '/search/s/result',
      component: SearchResult
    }]
  }, {
    path: '/',
    redirect: '/home'
  }, {
    path: '/register',
    component: Register
  }, {
    path: '*',
    component: NotFount
  }
]

const router = new VueRouter({
  routes
})

export default router
